package com.xsnet.grpc;


import com.xsnet.grpc.annotation.GrpcService;
import io.grpc.stub.StreamObserver;
import org.springframework.stereotype.Service;

@GrpcService
@Service
public class HelloService2 extends HelloGrpc.HelloImplBase {
    @Override
    public void sayHello(HelloOuterClass.HelloRequest request, StreamObserver<HelloOuterClass.HelloReply> responseObserver) {
        System.out.println("hello2:" + request.getName());
        HelloOuterClass.HelloReply reply = HelloOuterClass.HelloReply.newBuilder().setMessage("Hello " + request.getName()).build();
        responseObserver.onNext(reply);
        responseObserver.onCompleted();
    }
}
